﻿namespace HomeworkOppPartOne
{
    using System;
    
    enum BatteryType { LiIon, NiMH, NiCd }
    class Battery
    {
        private string BatteryModel{ get; set; }
        private double hoursIdle;
        private double hoursTalk;
        private BatteryType battType;

        public Battery()
        {
            this.BatteryModel = BatteryModel;
            this.HoursIdle = hoursIdle;
            this.HoursTalk = hoursTalk;
            this.BattType = battType;
        }
        public Battery(string batteryModel)
            : this()
        {
        }

        public Battery(string batteryModel, double hoursIdle)
            : this()
        {
        }

        public Battery(string batteryModel, double hoursIdle, double hoursTalk)
            : this()
        {
        }

        public Battery(string batteryModel, double hoursIdle, double hoursTalk, BatteryType battType)
            : this()
        {
        }

        internal double HoursIdle
        {
            get { return this.hoursIdle; }
            private set
            {
                if (value < 0)
                {
                    throw new ArgumentException("Invalid Input! Time can't be negative;!");
                }
                this.hoursIdle = value;
            }
        }
        internal double HoursTalk
        {
            get { return this.hoursTalk; }
            private set
            {
                if (value < 0)
                {
                    throw new ArgumentException("Invalid Input! Time can't be negative;!");
                }
                this.hoursTalk = value;
            }
        }
        internal BatteryType BattType
        {
            get { return this.battType; }
            private set
            {
                if ((value != BatteryType.LiIon) && (value != BatteryType.NiCd) && (value != BatteryType.NiMH))
                {
                    throw new ArgumentException("Invalid input! Wrong battery type!");
                }
                this.battType = value;
            }
        }
    }
}
